//
//  BC_BoardController.h
//  CocOth
//
//  Created by BrunoCausse on 04/11/10.
//  Copyright 2010-2013 poulailler cie. All rights reserved.
//

#import <Cocoa/Cocoa.h>

@class CocOthAppController;

@class BC_Move;
@class BC_BoardView;
@class BC_Board;


extern NSString * const BC_design2DKey;
extern NSString * const BC_ShowHideCoord;



@interface BC_BoardController : NSObject {
	
	IBOutlet CocOthAppController *appController;
//	IBOutlet NSWindow *boardWindow;
	IBOutlet BC_BoardView *boardView;
	
	IBOutlet NSMenuItem *menuView;
	IBOutlet NSMenuItem *showHideMenuItem;
	
	BC_Board *board;
	
}

@property(readwrite, retain) BC_Board *board;

- (IBAction)setDesign2D:(id)sender;
- (IBAction)showHideCoordinated:(id)sender;



- (NSString *)design2D;

- (int)player;

- (NSString *)nameVariationAtRow:(int)row column:(int)column;
- (NSString *)scoreAtRow:(int)row column:(int)column;
- (void)addVariationAtRow:(int)row column:(int)column;
- (void)removeVariationAtRow:(int)row column:(int)column;
- (void)setTag:(int)tag atRow:(int)row column:(int)column;
- (int)tagAtRow:(int)row column:(int)column;

- (int)discAtRow:(int)row column:(int)column;
- (BOOL)isLegalAtRow:(int)row column:(int)column;
- (BOOL)doMoveAtRow:(int)row column:(int)column;
- (BOOL)isEndgame;
- (BOOL)shouldPass;


- (void)reset;

- (void)doMove:(BC_Move *)move;
- (BOOL)forward;

- (void)undoMove:(BC_Move *)move;
- (BOOL)backstep;

- (void)needsDisplay;

- (void)openFile:(NSString *)filename;
- (void)tryParseString:(NSString *)pString;

- (int)n_empties;
- (NSString *)descriptionForZoo;
- (NSString *)descriptionForScript;


@end
